import time

import button
import theme.theme1
import theme.theme2


class Config:

    food_color = theme.theme2.food_color
    snake_head_color = theme.theme2.snake_head_color
    snake_body_color = theme.theme2.snake_body_color
    background_color = theme.theme2.background_color
    border_color = theme.theme2.border_color
    font_color = theme.theme2.font_color
    first_screen_color = theme.theme2.first_screen_color
    game_description_color = theme.theme2.game_description_color
    start_game_btn_color = theme.theme2.start_game_btn_color

    time_num = time.time()
    start_time = time.time()
    dead_time = 0
    speed = 0.1

    game_title = "贪吃蛇"

    score_title = "分数"

    def changeTheme(screen, event):
        if button.theme1(screen, event):
            Config.food_color = theme.theme1.food_color
            Config.snake_head_color = theme.theme1.snake_head_color
            Config.snake_body_color = theme.theme1.snake_body_color
            Config.background_color = theme.theme1.background_color
            Config.border_color = theme.theme1.border_color
            Config.font_color = theme.theme1.font_color
            Config.first_screen_color = theme.theme1.first_screen_color
            Config.game_description_color = theme.theme1.game_description_color
            Config.start_game_btn_color = theme.theme2.start_game_btn_color
        if button.theme2(screen, event):
            Config.food_color = theme.theme2.food_color
            Config.snake_head_color = theme.theme2.snake_head_color
            Config.snake_body_color = theme.theme2.snake_body_color
            Config.background_color = theme.theme2.background_color
            Config.border_color = theme.theme2.border_color
            Config.font_color = theme.theme2.font_color
            Config.first_screen_color = theme.theme2.first_screen_color
            Config.game_description_color = theme.theme2.game_description_color
            Config.start_game_btn_color = theme.theme2.start_game_btn_color
